package com.cl.security.core.entity;

import com.cl.security.base.entity.BaseEntity;
import com.cl.security.base.entity.TreeEntity;
import com.cl.security.system.entity.User;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

@Entity
@Table(name = "mall_order")
@Getter
@Setter
@SQLDelete(sql = "update mall_order set deleted=1 where id=?")
@Where(clause = "deleted<>1")
public class Order extends BaseEntity {

    private String address;
    @ManyToOne
    private User user;

    @OneToMany
    private Set<Sku> skus = new HashSet<>();
    @OneToOne
    private Product product;

}
